#/usr/bin/bash

iter=5

if [ $# -lt 2 ] 
then
    echo Usage: eval.sh orgin target
    exit
fi

origin=$1
target=$2

rm -rf BFS_m.log BFS_m.tim Key_m.log Key_m.tim

echo Starting

for i in `seq 1 $iter` ; do
    echo Trial $i

    echo BFS
    echo >> BFS_m.log
    echo Trial $i >> BFS_m.log
    echo >> BFS_m.log
    ( time java traverser/TrieTraverser $origin $target >> BFS_m.log ) 2>> BFS_m.tim

    echo Key
    echo >> Key_m.log
    echo Trial $i >> Key_m.log
    echo >> Key_m.log
    ( time java traverser/KeywordTraverser $origin $target >> Key_m.log ) 2>> Key_m.tim
done


echo Finished

